import React, {Component} from 'react'
import { Input, DatePicker, Button, Select, Form } from 'antd'

const Search =　Input.Search
const Option = Select.Option
const FormItem = Form.Item


class CourseDetail extends Component {
  constructor() {
    super()
    this.state = {
    }
    this.directorChange = this.directorChange.bind(this)
    this.needChange = this.needChange.bind(this)
  }

  directorChange(value) {
    console.log(`selected ${value}`);
  }

  needChange(value) {
    console.log(`selected ${value}`);
  }
  render() {
    const children = []
    for (let i = 10; i < 36; i++) {
      children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>)
    }
    const { getFieldDecorator } = this.props.form
    return (
      <div className="rt-stu-new">
        <Form inline className="rt-form-course rt-form-new">
          <FormItem
            label="名称"
          >
            {getFieldDecorator('name')(
              <Input placeholder="请输入课程名称"/>
            )}
          </FormItem>
          <FormItem
            label="需求标签"
          >
          {getFieldDecorator('need')(
            <Select
              tags
              style={{ width: '100%' }}
              className="rt-select-tag"
              onChange={this.needChange}
              tokenSeparators={[',']}
            >
              {children}
            </Select>
          )}
          </FormItem>
          <FormItem
            label="编号"
          >
          {getFieldDecorator('email')(
            <Input placeholder="请输入学员邮箱"/>
          )}
          </FormItem>
          <FormItem
            label="创建日期"
          >
            {getFieldDecorator('newDate')(
              <DatePicker placeholder="请选择日期"/>
            )}
          </FormItem>
        </Form>
        <Form inline className="rt-form-level rt-course-director">
          <FormItem
            label="负责人"
          >
            {getFieldDecorator('director')(
              <Select
                tags
                style={{ width: '100%' }}
                className="rt-select-tag"
                onChange={this.directorChange}
                tokenSeparators={[',']}
              >
                {children}
              </Select>
            )}
          </FormItem>
        </Form>
      </div>
     )
  }
}

export default Form.create()(CourseDetail)